import axios from "./index"
export function get(url, param) {
    return new Promise((resolve, reject) => {
        axios.get(url, { params: param }).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
export let post = (url, data) => {
    return new Promise(async (resolve, reject) => {
        axios.post(url, data).then(res => {
            return resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
export let del = (url, data) => {
    return new Promise(async (resolve, reject) => {
        axios.delete(url, data).then(res => {
            return resolve(res)
        }).catch(err => {
            return reject(err)
        })
    })
}
export let put = (url, data) => {
    return new Promise(async (resolve, reject) => {
        axios.put(url, data).then(res => {
            return resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
export let search = (url, data) => {
    return new Promise(async (resolve, reject) => {
        axios.get(url, data).then(res => {
            return resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}


